Skip to content

fix(FOUR-26702): preserve ampersand in plain case titles from mustach… - #9172

Open
gproly wants to merge 2 commits into
developfrom
bugfix/FOUR-26702
Open

gproly wants to merge 2 commits into
developfrom
bugfix/FOUR-26702

Conversation

@gproly

@gproly gproly commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Mustache HTML-escaping on case_title stored "&" as "&" when titles used dropdown values, breaking Core case review text display. Use identity escape for plain titles; keep htmlspecialchars on case_title_formatted for v-html list views.

https://processmaker.atlassian.net/browse/FOUR-26702

ci:deploy

…e fields

Mustache HTML-escaping on case_title stored "&" as "&" when titles
used dropdown values, breaking Core case review text display. Use
identity escape for plain titles; keep htmlspecialchars on
case_title_formatted for v-html list views.

https://processmaker.atlassian.net/browse/FOUR-26702
Move the formatted case title 200-character loop into
truncateFormattedCaseTitle to keep evaluateCaseTitle under the cognitive
complexity limit (S3776). No behavior change.

https://processmaker.atlassian.net/browse/FOUR-26702
@cursor

cursor Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

PR Summary

Low Risk
Localized change to case title rendering and a small refactor; formatted HTML output behavior is preserved and covered by new tests.

Overview
Fixes plain case titles (evaluateCaseTitle with formatted = false) so Mustache substitutions keep literal characters such as & instead of being HTML-escaped to &, which was breaking Core case review text when titles used dropdown values.

Formatted titles (formatted = true) are unchanged: values still go through htmlspecialchars, wrap in <b>, and are truncated via a new truncateFormattedCaseTitle helper (same 200-character behavior as before, extracted from inline logic).

Unit tests cover ampersand handling for both plain and formatted paths.

Reviewed by Cursor Bugbot for commit 75b948d. Bugbot is set up for automated code reviews on this repo. Configure here.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔒 Agentic Security Review — 1 finding(s).

  • [MEDIUM] ProcessMaker/Models/ProcessRequest.php:1081 — Unformatted case-title rendering now stores participant request values with no HTML encoding. The default task inbox inserts that stored string into HTML and renders it with v-html after a sanitizer that only removes script and style tags, so an event-handler payload runs in the viewer's session.
    • Impact: A participant who can fill a field referenced by the process case-title mustache can store markup in process_requests.case_title. Assignees and process managers who open the default task list execute that markup in their authenticated browser session (same origin, CSP allows unsafe-inline). That session can perform the victim's task and API actions. Inbox-rule execution logs have the same sink because they v-html task.process_request.case_title directly. The formatted title path still encodes interpolated values, and request listings that actually receive a non-empty case_title_formatted stay on that encoded string.
    • Remediation: HTML-encode case_title at every HTML interpolation, including TasksList.formatCaseTitle and FilterTable cells that v-html task.process_request.case_title. Alternatively include case_title_formatted in the optimized processRequest select and render that string in the task cell. Keep the raw case_title value for text-only bindings so ampersands are not double-encoded. Treating removeScripts as the fix is insufficient; it does not strip event-handler tags.

@nolanpro

Copy link
Copy Markdown
Contributor

QA server K8S was successfully deployed https://tenant-1.ci-79269ba254.engk8s.processmaker.net

@decisions-sonarqube

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants